#include "tcp_client.hpp"
#include <memory>
using namespace std;

static void usage(std::string proc)
{
    std::cout << "Usage:\n\t" << proc << " serverip serverport\n"
              << std::endl;
}

int main(int argc, char *argv[]){
    // 准备工作
    if(argc != 3)
    {
        usage(argv[0]);
        exit(USAGE_ERR);
    }
    string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);
    unique_ptr<tcpClient> tcli(new tcpClient(serverip,serverport));
    tcli->initClient();
    tcli->start();
    return 0;
}